<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>VueTest</title>
</head>
<body>
<!--view层，模板-->
<div id="app">
    <li v-for="(item,index) in items">
        {{item.message}}---{{index}}
    </li>
</div>
<!--1.导入Vue.js-->
<script src="https://cdn.jsdelivr.net/npm/vue@2.5.21/dist/vue.min.js"></script>
<script type="text/javascript">
    let vm = new Vue({
        el: "#app",
        data: {
            items: [
                {message: "Ace,I'm coming home!"},
                {message: "cayde 6"},
                {message: "destiny 2"}
            ]
        }
    });
</script>
<!--
items是数组，item是数组元素迭代的别名，index是迭代的序号
打开控制台，在控制台输入vm.items.push({message: "guardian"})，尝试追加一条数据，会发现页面也添加了数据
-->
</body>
</html>
